{% extends "empty_page.html" %}

{% load i18n %}
{% block title %} {% trans "report" %} {% endblock %}

{% block body %}
<head>
    <style type="text/css">

        .report {font-size: 85%;
                width:80%;
                height:40%;
                margin: 0 auto;                
                }
        
        td      {
                text-align:center;

                }
        table{
                border-collapse:collapse;
            }

    </style>
</head>


<div class="report">
{% if productionline %}
<a class="btn btn-sm btn-success pull-right" href="{% url generate_reject_project_pdf productionline.id %}" target="_blank">{% trans 'pdf' %}</a><br>
{% endif %}
    <h3>质 量 记 录</h3> <h5>{{code}}</h5>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>编号</th>
            <th>零件</th>
            <th>工序</th>
            <th>工种</th>
            <th>质 量 问 题</th>
            <th>原 因 分 析</th>
            <th>处 理 结 果</th>
            <th>检验员</th>
            <th>时间</th>
        </tr>
        </thead>
        {% for reject_product_record in reject_product_records %}
        <tr>
            <td>{{reject_product_record.code}}</td>
            <td>{{reject_product_record.qa_record.manufacture_item}}</td>
            <td>{{reject_product_record.qa_record.operation_record.oper_group_record.operation_group.name}}</td>
            <td>{{reject_product_record.qa_record.operation_record.oper_group_record.operation_group.Job.position}}</td>
            <td>{{reject_product_record.quality_problems}}</td>
            <td>{{reject_product_record.reason_analysis}}</td>
            <td>{{reject_product_record.processing_result}}</td>
            <td>{{reject_product_record.qa_record.decider|default_if_none:""}}</td>
            <td>{{reject_product_record.date_added.date|date:"Y-m-d"}}</td>
        </tr>
        {% endfor %}
    </table>


{% if productionline %}
    <h3>超差件编号记录</h3>

    <table class="table table-bordered">
        <tr>
            <td>超差件编号</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <tr>
            <td>质疑单号</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>超差件编号</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <tr>
            <td>质疑单号</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
<div>
{% endif %}

{% endblock %}